package com.joven.shelltest.utils.obersever;

import org.springframework.stereotype.Service;

/**
 * 观察者主体
 * @Author wzj
 * @Date 2023-09-19 10:10
 **/
@Service
public class ThirdPartyConditions implements Observer{

    private float temperature;
    private float pressure;
    private float humidity;

    @Override
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    public void display() {
        System.out.println("***********第三方软件接收信息************");
        System.out.println("今天的气温 " + temperature);
        System.out.println("今天的气压 " + pressure);
        System.out.println("今天的湿度 " + humidity);
    }
}
